package com.utils;

import java.nio.ByteBuffer;

public class ByteUtils {
    public static boolean getByteToBoolean(byte v){
        return (v & 0xFF)==0;
    }
    public static float getByteToInt(byte b1) {
        return b1 & 0xFF;
    }

    public  static int getByteToInt(byte b1, byte b2){
       return  (b1 & 0xFF | (b2 & 0xFF) << 8);
    }
    public static int getByteToInt(byte b1, byte b2, byte b3, byte b4){
        return b1 & 0xFF |
                (b2 & 0xFF) << 8 |
                (b3 & 0xFF) << 16 |
                (b4 & 0xFF) << 24;
    }

}
